package service;

import dao.TypeDao;
import model.Type;

import java.sql.SQLException;
import java.util.List;

//获得商品类型
public class TypeService {
    private TypeDao tDao = new TypeDao();

    //获得全部商品类型
    public List<Type> selectAll(){
        List<Type> list=null;
        try {
            list = tDao.selectAll();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return list;
    }

    //选择商品类型
    public Type select(int id){
        Type t=null;
        try {
            t = tDao.select(id);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return t;
    }
}
